#{extends 'adminm/frame.html' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/edit.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/common.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/commodity.scss'}" />
#{/set}
#{set 'moreScripts'}
<script src="@{'/public/pager/jquery.pager.js'}" type="text/javascript" charset="utf-8"></script>
#{/set}
#{set 'activeItem'}4#{/set}
<script language="javascript">
$(function(){
	$("#mi_order").addClass("menu-select");
});
</script>
<div class="navigationBar">
	<table>
		<tr>
			<td><img src="@{'/public/images/navigationHouse.gif'}"></td>
			<td><strong>当前位置：</strong></td>
			<td>
				<a href="/">首页</a>
				>>
				<a href="/users">会员中心</a>
				>>
				<a href="/users/order">订单管理</a>
				>>
				<font class="current">订单详细情况</font>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
function goback() {
	window.location.href="/admin/order/index";
}

function deleteItem(id) {
	if(!confirm("确定删除此记录("+id+")？")) return;
	$.ajax({
		url: "/admin/order/delete/"+id,
		type: "DELETE",
		dataType: "json",
		complete: function(XMLHttpRequest, textStatus, errorThrown) {
			if(textStatus == "error") {
				var errJson = eval("("+XMLHttpRequest.responseText+")");
				var errMsg = "操作失败，"+errJson.message;
				$("#errMsg").html(errMsg);
				alert(errMsg);
			}
			goback();
		}
	});
}
function updateOrderSended(id) {
	if(!confirm("确定吧此订单("+id+")标记为已发货状态？")) return;
	$.ajax({
		url: "/admin/order/sending/"+id,
		//data: dataStr,
		type: "PUT",
		dataType: "json",
		complete: function(XMLHttpRequest, textStatus, errorThrown) {
			if(textStatus == "error") {
				var errJson = eval("("+XMLHttpRequest.responseText+")");
				var errMsg = "操作失败，"+errJson.message;
				$("#errMsg").html(errMsg);
				alert(errMsg);
			}
			goback();
		}
	});
}
</script>
</table>
<div id="edit-comment">
	<input type="button" value="返回上页" onClick="goback()">&nbsp;&nbsp;&nbsp;
	<input type="button" value="已发货" onClick="updateOrderSended(${order.id})">&nbsp;&nbsp;&nbsp;
	<input type="button" value="删除记录" onClick="deleteItem(${order.id})">
	#{users/orderDetail order:order /}
	#{users/remittanceConfirm remittanceConfirms:remittanceConfirms /}
</div>

<center><input type="button" value="返回上页" onclick="goback()"></center>
<br><br>